package com.bmps.springcloud.insuredmicroservice.service.cancelpolicy;

import com.bmps.springcloud.insuredmicroservice.repository.cancel.master.CancelPolicyRepository;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * description:
 *
 * @author jackdaw
 * @date 2019-11-27 16:35
 */

@Service
public class CancelPolicyServiceImpl implements CancelPolicyService {
    private final CancelPolicyRepository cancelPolicyRepository;

    public CancelPolicyServiceImpl(CancelPolicyRepository cancelPolicyRepository) {
        this.cancelPolicyRepository = cancelPolicyRepository;
    }

    @Override
    public Map<String, Object> getPolicyInfo(String contNo) {
        return cancelPolicyRepository.getPolicyMessage(contNo);
    }

    @Override
    public int cancelPolicy(String contNo,int state) {
        return cancelPolicyRepository.cancelPolicy(contNo,state);
    }
}
